import xlrd
# 1.先打开xlsx文件
xlsx = xlrd.open_workbook('e:/我的学习日志2024版/12-5/test.xlsx')
# 获取指定的标签页
table = xlsx.sheet_by_index(0)
#3. 获取到表格中有多少行
nrows = table.nrows
print(f"nrows = {nrows}")
#4.循环统计
total = 0
cnt = 0
for i in range(1,nrows):
    # 拿到当前同学的班级 id
    if table.cell_value(i,1)==100:
        cnt+=1
        total+=table.cell_value(i,2)
print(total/cnt)